package date.Exa3;

import java.time.LocalDate;
import java.time.temporal.TemporalAdjuster;

/**
 * 日期调整类学习
 */
public class TemporalAdjustersStudy {

    public static void main(String[] args) {

        //自定义日期计算器，计算下一个工作日
        TemporalAdjuster next_workDay = w->{
          LocalDate result = (LocalDate)w;
          do{
              result = result.plusDays(1);
          }while(result.getDayOfWeek().getValue()>=6);
          return result;
        };

        //使用日期计算器得到想要的日期
        LocalDate today = LocalDate.now();
        LocalDate target = today.with(next_workDay);
        System.out.println(target);

    }
}
